﻿using DAL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class PaiRoomBLL
    {
        public PaiRoomDAL PaiRoomDAL { get; }

        public PaiRoomBLL(PaiRoomDAL paiRoomDAL)
        {
            PaiRoomDAL = paiRoomDAL;
        }

        /// <summary>
        /// 排房添加
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int PaiRoomAdd(PaiRoomMoodel info)
        {
            try
            {
               return PaiRoomDAL.PaiRoomAdd(info);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 显示查询分页
        /// </summary>
        /// <param name="totalCount">页容量</param>
        /// <param name="totalPage">页码</param>
        /// <param name="Pageindex">当前页</param>
        /// <param name="PageSize">页码</param>
        /// <returns></returns>
        public IQueryable GetPaiRooList(out int totalCount, out int totalPage, int Pageindex = 1, int PageSize = 2)
        {
            try
            {
               return PaiRoomDAL.GetPaiRooList(out totalCount, out totalPage, Pageindex, PageSize);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int PaiRoomDel(int id)
        {
            try
            {
              return PaiRoomDAL.PaiRoomDel(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量逻辑删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int PaiRoomDelAll(string ids)
        {
            try
            {
                return PaiRoomDAL.PaiRoomDelAll(ids);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量修改状态
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public int PaiRoomUptAll(string ids, int state)
        {
            try
            {
                return PaiRoomDAL.PaiRoomUptAll(ids, state);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// Id查询(反填)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public PaiRoomMoodel GetPaiRoomId(int id)
        {
            try
            {
                return PaiRoomDAL.GetPaiRoomId(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int GetRPaiRoomUpdate(PaiRoomMoodel info)
        {
            try
            {

                return PaiRoomDAL.GetRPaiRoomUpdate(info);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
